﻿using System;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Ink;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using System.Collections.Generic;
using System.Reflection;
using System.Linq;

namespace SilverlightSdms.Common
{
    public static class ExtensionMethods
    {
        public static string[] GetEnumNames(this Type EnumType)
        {
            if (!EnumType.IsEnum)
                throw new ArgumentException("GetEnumNames: Type '" + EnumType.Name + "' is not an enum");

            return
                (
                  from field in EnumType.GetFields(BindingFlags.Public | BindingFlags.Static)
                  where field.IsLiteral
                  select field.Name
                )
                .ToArray();
        }
    }
}
